import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    id: sessionStorage.getItem('id') || '',
    uname: sessionStorage.getItem('uname') || '',
    // 记住位置
    site: '',
    // 记住跳转位置
    redirect: ''
  },
  mutations: {
    setId(state, payload) {
      state.id = payload
    },
    setUname(state, payload) {
      state.uname = payload
    },
    // 修改定位
    setSite(state, sdring) {
      state.site = sdring
    },
    setGoto(state, goto) {
      state.redirect = goto
    }

  },
  actions: {
  },
  modules: {
  }
})
